import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

// 场次类
class Session {
    private String sessionId;
    private String movieId;
    private String hallId;
    private LocalDateTime startTime;
    private double price;
    private Map<String, String> bookedSeats; // 座位号 -> 票号

    public Session(String sessionId, String movieId, String hallId, LocalDateTime startTime, double price) {
        this.sessionId = sessionId;
        this.movieId = movieId;
        this.hallId = hallId;
        this.startTime = startTime;
        this.price = price;
        this.bookedSeats = new HashMap<>();
    }

    // Getters and Setters
    public String getSessionId() {
        return sessionId;
    }

    public String getMovieId() {
        return movieId;
    }

    public void setMovieId(String movieId) {
        this.movieId = movieId;
    }

    public String getHallId() {
        return hallId;
    }

    public void setHallId(String hallId) {
        this.hallId = hallId;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Map<String, String> getBookedSeats() {
        return bookedSeats;
    }

    public boolean isSeatBooked(String seatId) {
        return bookedSeats.containsKey(seatId);
    }

    public void bookSeat(String seatId, String ticketId) {
        bookedSeats.put(seatId, ticketId);
    }

    public String releaseSeat(String seatId) {
        return bookedSeats.remove(seatId);
    }

    public int getBookedSeatCount() {
        return bookedSeats.size();
    }
}
